// Programming_Scala/src/ch03/try-catch-script.scala

import java.util.Calendar

val then = null
val now = Calendar.getInstance()

try {
  now.compareTo( then )
} catch {
  case e: NullPointerException => println( "Something was null!" )
  case unknown => println( "Unknown exception " + unknown )
} finally {
  println( "It all worked out." )
  System.exit( 0 )
}
